package bird

import (
	"github.com/gin-gonic/gin"
	kgin "github.com/go-kratos/gin"
	"github.com/go-kratos/kratos/v2/middleware/recovery"
)

type WebsocketGinServer interface {
	HandleWebSocket(c *gin.Context)
}

func RegisterWebsocketGinServer(router *gin.Engine,
	srv WebsocketGinServer,
) {
	// 使用kratos中间件
	router.Use(kgin.Middlewares(recovery.Recovery()))
	groupTop := router.Group("/ws")
	group := groupTop.Group("/drone")
	group.GET("/locate/", srv.HandleWebSocket)
	//group.GET("/", srv.HandleWebSocket)
}
